package com.ruoyi.a2.service.impl;

import java.util.List;

import com.ruoyi.common.enums.CommonOKNOEnum;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.a2.mapper.A2TargetPabcMapper;
import com.ruoyi.a2.domain.A2TargetPabc;
import com.ruoyi.a2.service.IA2TargetPabcService;

/**
 * 目标异常行为配置Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-14
 */
@Service
public class A2TargetPabcServiceImpl extends ServiceImpl<A2TargetPabcMapper, A2TargetPabc> implements IA2TargetPabcService
{
    @Autowired
    private A2TargetPabcMapper a2TargetPabcMapper;

    /**
     * 查询目标异常行为配置
     *
     * @param id 目标异常行为配置主键
     * @return 目标异常行为配置
     */
    @Override
    public A2TargetPabc selectA2TargetPabcById(Long id)
    {
        return a2TargetPabcMapper.selectA2TargetPabcById(id);
    }

    /**
     * 查询目标异常行为配置列表
     *
     * @param a2TargetPabc 目标异常行为配置
     * @return 目标异常行为配置
     */
    @Override
    public List<A2TargetPabc> selectA2TargetPabcList(A2TargetPabc a2TargetPabc)
    {
        return a2TargetPabcMapper.selectA2TargetPabcList(a2TargetPabc);
    }

    /**
     * 新增目标异常行为配置
     *
     * @param a2TargetPabc 目标异常行为配置
     * @return 结果
     */
    @Override
    public int insertA2TargetPabc(A2TargetPabc a2TargetPabc)
    {
        a2TargetPabc.setCreateTime(DateUtils.getNowDate());
        return a2TargetPabcMapper.insertA2TargetPabc(a2TargetPabc);
    }

    /**
     * 修改目标异常行为配置
     *
     * @param a2TargetPabc 目标异常行为配置
     * @return 结果
     */
    @Override
    public int updateA2TargetPabc(A2TargetPabc a2TargetPabc)
    {
        a2TargetPabc.setUpdateTime(DateUtils.getNowDate());
        return a2TargetPabcMapper.updateA2TargetPabc(a2TargetPabc);
    }

    /**
     * 批量删除目标异常行为配置
     *
     * @param ids 需要删除的目标异常行为配置主键
     * @return 结果
     */
    @Override
    public int deleteA2TargetPabcByIds(Long[] ids)
    {
        return a2TargetPabcMapper.deleteA2TargetPabcByIds(ids);
    }

    /**
     * 删除目标异常行为配置信息
     *
     * @param id 目标异常行为配置主键
     * @return 结果
     */
    @Override
    public int deleteA2TargetPabcById(Long id)
    {
        return a2TargetPabcMapper.deleteA2TargetPabcById(id);
    }

    @Override
    public List<A2TargetPabc> getListByEnableOK() {
        A2TargetPabc a2TargetPabc = new A2TargetPabc();
        a2TargetPabc.setEnableStatus(CommonOKNOEnum.OK.getCode());
        return this.selectA2TargetPabcList(a2TargetPabc);
    }
}
